package com.snail.readyvr.util;

import com.github.pwittchen.networkevents.library.BusWrapper;

/**
 * Created by MRKING on 2016/5/5.
 */
public class DefaultBusWrapper implements BusWrapper {

    private static volatile DefaultBusWrapper instance = null;
    private DefaultBusWrapper(){}

    public static DefaultBusWrapper getInstance(){
        if(instance == null){
            synchronized (DefaultBusWrapper.class){
                if (instance == null)
                    instance = new DefaultBusWrapper();
            }
        }
            return  instance;
    }


    @Override
    public void register(Object o) {
        EventBus.getDefault().register(o);
    }

    @Override
    public void unregister(Object o) {
        EventBus.getDefault().unregister(o);
    }

    @Override
    public void post(Object o) {
        EventBus.getDefault().post(Constant.BusTag.NET_WORK_TAG,o);
    }
}
